<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page isELIgnored="false"%>
<html>
<head>
    <title>Listado de facturas</title>
    <style type="text/css" media="all">
          @import url("<spring:url value="/resources/css/efacturas.css"/>");
    </style>
</head>

<div id="container">

    <jsp:include page="header.jsp" />

    <jsp:include page="navigation.jsp" />    

    <div id="content">
    
  <form:form action="/billing/addBill" commandName="billingEntry">
    
    <form:errors path="*" cssClass="error" element="div"/>      
      
    <fieldset>
    <legend>Datos de la nueva entrada</legend>
    
      <table>
          <tr>
              <td><form:label  path="concept">Concepto</form:label>
                  <form:select path="concept.id">
                      <c:forEach items="${conceptList}" var="currentConcept" varStatus="status">
                          <form:option value="${conceptList[status.count -1].id}" >${conceptList[status.count -1].description}</form:option>
                      </c:forEach>
                  </form:select>
              </td>
              
              <td><form:label  path="amount">Cantidad</form:label>
                 <form:input  path="amount" />        
              </td>
              
              <td>
              <form:label  path="date">Fecha</form:label>
              <form:input  path="date" />
              </td>
          </tr>

        <tr>
            <td colspan="3">
                  <form:label path="description" >Descripcion</form:label>
                  <form:textarea rows="5" cols="150" path="description" />            
            </td>    
        </tr>
          
      </table>
    </fieldset>
    
    <fieldset>
    
     <table>
         <tr>
             <td colspan="2"><legend>Datos del beneficiario</legend></td>
         </tr>
                   
          <tr>
              <td width="50%"> 
                 <form:select path="payee.id">
                      <c:forEach items="${ownerList}" var="current" varStatus="status">
                          <form:option value="${ownerList[status.count -1].id}" >${ownerList[status.count -1].firstFamilyName} ${ownerList[status.count -1].secondFamilyName},${ownerList[status.count -1].firstName}</form:option>
                      </c:forEach>
                  </form:select>
             </td>
             
             <td width="50%">
                 <table>
                     <tr>
                         <td> Direccion: Calle Gregorio Prieto </td>
                         <td> Telefono: 98745631</td>
                     </tr>
                      <tr>
                         <td> Numero de cuenta: 1231 6489 64649 </td>
                         <td> IBAN: ES987456256646431</td>
                     </tr>                    
                 
                 </table>
             </td>
             
          </tr>
          
        <tr>
             <td colspan="2"><legend>Datos del pagador</legend></td>
         </tr>
          
        <tr>
              <td width="50%"> 
                 <form:select path="payer.id">
                      <c:forEach items="${ownerList}" var="current" varStatus="status">
                          <form:option value="${ownerList[status.count -1].id}" >${ownerList[status.count -1].firstFamilyName} ${ownerList[status.count -1].secondFamilyName},${ownerList[status.count -1].firstName}</form:option>
                      </c:forEach>
                  </form:select>
             </td>
             <td width="50%">
                 <table>
                     <tr>
                         <td> Direccion: Calle Gregorio Prieto </td>
                         <td> Telefono: 98745631</td>
                     </tr>
                      <tr>
                         <td> Numero de cuenta: 1231 6489 64649 </td>
                         <td> IBAN: ES987456256646431</td>
                     </tr>                    
                 
                 </table>
             </td>
             
             
          </tr>
          </table>
    </fieldset>
    
    <input type="submit" value="Enviar" />
  </form:form>
  
    </div>
    <div id="footer">
        Copyright © Victor Ferrer, 2012
    </div>
</div>

</body>
</html>

